flowchart TD A[TsPpgRawData] --> B[TsPpgRawNodeData]
PPG
Quick access
Intro
Biometry subsystem provides functions to access PPG functionality.
Note:
Since TsPPG is a member of the device class, it cannot be used independently without an active Teslasuit device.
Class TsPpg
Handles PPG (Photoplethysmography) sensor data processing and streaming. This class manages the interaction with a PPG sensor, including raw and processed data streaming, calibration, and retrieving heart rate variability (HRV) and raw PPG data.
Class methods:
start_raw_streaming(self)Start the streaming of a PPG raw data
stop_raw_streaming(self)Stop the streaming of a PPG raw data
get_hrv_data_on_ready(self)Blocks execution until HRV data is ready and returns the latest HRV data.
Returns:
TsHrv(struct) The latest HRV data.
get_raw_data_on_ready(self)Blocks execution until raw PPG data is ready and returns the latest raw data.
Returns:
TsPpgRawData(struct): The latest raw PPG data.
get_hrv(self)Retrieves the latest HRV data.
Returns:
TsHrv(struct): The latest HRV data.
get_data_raw(self)Retrieves the latest raw PPG data.
Returns:
TsPpgRawData(struct): The latest raw PPG data.
get_data(self)Retrieves the latest processed PPG data.
Returns:
TsPpgData: The latest processed PPG data.
NB! TsPpgData struct doesn’t provide any parameters such as “heart_rate”. The access is given through the TsPpgNodeData struct. Please see the example.
calibrate(self)Calibrates PPG processor. The calibration procedure is capturing interval of the raw data during 3 seconds. The captured interval will be used in calculation of all ppg parameters. By default, calibration procedure starts on starting PPG processor. In case on bad start, the calibration procedure might be restarted using this function.
Access to the data
These code snippets and charts are just an example of how is the data flow looks like. to know more, please visit data structures page.
Access to raw data
TsPpg.get_raw_data_on_ready().nodes[0].ir_dataAccess to HRV data
TsPpg.get_hrv_data_on_ready().mean_rrAccess to heart rate data
TsPpg.get_data().nodes[0].heart_rateflowchart TD A[TsPpgData] --> B[TsPpgNodeData]